# branch: stable
#   git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
#   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
#   https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux.git
#   https://mirrors.tuna.tsinghua.edu.cn/git/linux-stable.git
# branch: master
#   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
#   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
#   https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git
#   https://mirrors.tuna.tsinghua.edu.cn/git/linux.git
#   git@gitee.com:mirrors/Linux.git
#   https://gitee.com/mirrors/Linux.git
# branch: next
#   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
#   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
#   https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git
#   https://mirrors.tuna.tsinghua.edu.cn/git/linux-next.git

ifdef KL_GIT_URL_$(NET_SELECT)
KL_GIT_URL				?= $(KL_GIT_URL_$(NET_SELECT))
else
KL_GIT_URL				?= https://mirrors.tuna.tsinghua.edu.cn/git/linux-stable.git
endif
KL_SITE					?= https://mirrors.edge.kernel.org/pub/linux/kernel/v$(firstword $(subst ., ,$(KL_VERSION))).x
KL_BRANCH				?= master

KL_VERSION				?= 6.6
KL_BASE					?= linux-$(KL_VERSION)
KL_PKG 					?= $(KL_BASE).tar.xz


KL_TARGETS				?= all
KL_SAVECONF				?= $(KL_CONFIG)
KL_VMLINUX				?= $(O_KL_DIR)/vmlinux
KL_IMAGE				?= $(O_KL_DIR)/arch/$(KL_ARCH)/boot/Image
KL_VMLINUX_GDB_PY		?= $(O_KL_DIR)/vmlinux-gdb.py
KL_EMBED_RFS			?= 0


KL_SRC_DIR				?= kernel
KL_GIT_DIR				?= $(KL_SRC_DIR)/linux-repo
KL_VER_DIR 				?= $(KL_SRC_DIR)/$(KL_BASE)

S_KL_DIR				= $(EEL_SRC_DIR)/$(KL_VER_DIR)
G_KL_DIR				= $(EEL_SRC_DIR)/$(KL_GIT_DIR)
ifeq ($(BR_KL_ENABLE),1)
O_KL_DIR				= $(O_BR_DIR)/build/linux-custom
else
O_KL_DIR				= $(EEL_OUT_DIR)/$(ARCH)/$(KL_VER_DIR)/$(KL_CONFIG)
endif
ifneq ($(S_KL_DIR),$(wildcard $(S_KL_DIR)))
S_KL_DIR				= $(G_KL_DIR)
endif

QEO_IMAGES				+= -kernel $(KL_IMAGE)
ifneq ($(DTB_IMAGE),)
QEO_IMAGES				+= -dtb $(DTB_IMAGE)
endif

BOOTCONFIG				= $(S_KL_DIR)/tools/bootconfig/bootconfig

BCONF_FILE				?= presets/boottrace.bconf
